.class Lcom/example/m6shop/FindblueActivity$4;
.super Ljava/lang/Object;
.source "FindblueActivity.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/example/m6shop/FindblueActivity;->onCreate(Landroid/os/Bundle;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Landroid/widget/AdapterView$OnItemClickListener;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/example/m6shop/FindblueActivity;


# direct methods
.method constructor <init>(Lcom/example/m6shop/FindblueActivity;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    .line 135
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 8
    .param p2, "arg1"    # Landroid/view/View;
    .param p3, "arg2"    # I
    .param p4, "arg3"    # J
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .local p1, "arg0":Landroid/widget/AdapterView;, "Landroid/widget/AdapterView<*>;"
    const/4 v7, 0x0

    .line 140
    iget-object v5, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    # getter for: Lcom/example/m6shop/FindblueActivity;->mpairedDeviceList:Ljava/util/List;
    invoke-static {v5}, Lcom/example/m6shop/FindblueActivity;->access$0(Lcom/example/m6shop/FindblueActivity;)Ljava/util/List;

    move-result-object v5

    invoke-interface {v5, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    .line 142
    .local v3, "temString":Ljava/lang/String;
    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    add-int/lit8 v5, v5, -0x12

    invoke-virtual {v3, v7, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    .line 143
    .local v2, "name":Ljava/lang/String;
    iget-object v5, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    const-string v6, "blueInfo"

    invoke-virtual {v5, v6, v7}, Lcom/example/m6shop/FindblueActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v4

    .line 144
    .local v4, "userInfo":Landroid/content/SharedPreferences;
    invoke-interface {v4}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v5

    const-string v6, "name"

    invoke-interface {v5, v6, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    move-result-object v5

    invoke-interface {v5}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 146
    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    add-int/lit8 v5, v5, -0x11

    invoke-virtual {v3, v5}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v3

    .line 147
    iget-object v5, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    iget-object v6, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    # getter for: Lcom/example/m6shop/FindblueActivity;->mBluetoothAdapter:Landroid/bluetooth/BluetoothAdapter;
    invoke-static {v6}, Lcom/example/m6shop/FindblueActivity;->access$1(Lcom/example/m6shop/FindblueActivity;)Landroid/bluetooth/BluetoothAdapter;

    move-result-object v6

    invoke-virtual {v6, v3}, Landroid/bluetooth/BluetoothAdapter;->getRemoteDevice(Ljava/lang/String;)Landroid/bluetooth/BluetoothDevice;

    move-result-object v6

    invoke-static {v5, v6}, Lcom/example/m6shop/FindblueActivity;->access$2(Lcom/example/m6shop/FindblueActivity;Landroid/bluetooth/BluetoothDevice;)V

    .line 149
    :try_start_0
    iget-object v5, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    # getter for: Lcom/example/m6shop/FindblueActivity;->mBluetoothDevice:Landroid/bluetooth/BluetoothDevice;
    invoke-static {v5}, Lcom/example/m6shop/FindblueActivity;->access$3(Lcom/example/m6shop/FindblueActivity;)Landroid/bluetooth/BluetoothDevice;

    move-result-object v5

    # getter for: Lcom/example/m6shop/FindblueActivity;->SPP_UUID:Ljava/util/UUID;
    invoke-static {}, Lcom/example/m6shop/FindblueActivity;->access$4()Ljava/util/UUID;

    move-result-object v6

    invoke-virtual {v5, v6}, Landroid/bluetooth/BluetoothDevice;->createRfcommSocketToServiceRecord(Ljava/util/UUID;)Landroid/bluetooth/BluetoothSocket;

    move-result-object v5

    invoke-static {v5}, Lcom/example/m6shop/FindblueActivity;->access$5(Landroid/bluetooth/BluetoothSocket;)V

    .line 150
    # getter for: Lcom/example/m6shop/FindblueActivity;->mBluetoothSocket:Landroid/bluetooth/BluetoothSocket;
    invoke-static {}, Lcom/example/m6shop/FindblueActivity;->access$6()Landroid/bluetooth/BluetoothSocket;

    move-result-object v5

    invoke-virtual {v5}, Landroid/bluetooth/BluetoothSocket;->connect()V

    .line 152
    new-instance v1, Landroid/content/Intent;

    iget-object v5, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    const-class v6, Lcom/example/m6shop/BluetoothtextActivity;

    invoke-direct {v1, v5, v6}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 153
    .local v1, "intent":Landroid/content/Intent;
    iget-object v5, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    invoke-virtual {v5, v1}, Lcom/example/m6shop/FindblueActivity;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 159
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_0
    return-void

    .line 154
    :catch_0
    move-exception v0

    .line 155
    .local v0, "e":Ljava/io/IOException;
    iget-object v5, p0, Lcom/example/m6shop/FindblueActivity$4;->this$0:Lcom/example/m6shop/FindblueActivity;

    const-string v6, "\u8fde\u63a5\u5931\u8d25"

    const/16 v7, 0xbb8

    invoke-static {v5, v6, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v5

    invoke-virtual {v5}, Landroid/widget/Toast;->show()V

    .line 156
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_0
.end method
